﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

namespace SSO2.Controllers
{
    public class UserController : Controller
    {
        public IActionResult Index()
        {
            string userName = HttpContext.Session.GetString("user");

            if (string.IsNullOrWhiteSpace(userName))
            {
                return Content("你还没有登录!");
            }
            else
            {
                ViewBag.UserName = userName;
                ViewBag.LoginTime = HttpContext.Session.GetString("loginTime");
                ViewBag.SessionID = HttpContext.Session.Id;
            }

            return View();
        }
    }
}
